<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>

<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0,minimum-scale=1.0,user-scalable=0" />
	<title>诉求建议</title>
	<jsp:include page="../base/header.jsp"></jsp:include>
	<link rel="stylesheet" type="text/css" href="static/ssjf/css/comment.css">
	<script type="text/javascript" src="static/ssjf/js/comment.js"></script>
</head>
<body>
	<div class="container" id="header" style="background-color: #f86941;">
		<div class="row title">
			<div class="col-1 col-sm-1" onclick="javascript:location.href='ssjf/page/commentlist.html'"><img src="static/ssjf/img/symbol/back_arrow_w.png"></div>
			<div class="col-10 col-sm-10">诉求建议</div>
			<div class="col-1 col-sm-1"></div>
		</div>
	</div>
	<div class="container" id="content">
		<div class="row news_bar" value="${complained.id }">
			<div class="col-4 news_img"><img src="${complained.filePath }"></div>
			<div class="col-8 news_content">
				<div class="row news_title"><div class="col-12">${complained.company }</div></div>
				<div class="row news_detail"><div class="col-12">${complained.intro }</div></div>
			</div>
		</div>
		<div class="grey_line"></div>
		<div class="row font_t">
			<div class="col-12 smile">
				<div>
					<img src="static/ssjf/img/symbol/comment/comment01.png">
					<span>非常满意</span>
				</div>
				<div>
					<img src="static/ssjf/img/symbol/comment/comment03.png">
					<span>满意</span>
				</div>
				<div>
					<img src="static/ssjf/img/symbol/comment/comment05.png">
					<span>不满意</span>
				</div>
			</div>
		</div>
		<div class="grey_line"></div>
		<div class="row font_t">
			<div class="col-12 comment_tab">
					<div class="active">非常专业</div>
					<div>服务很好</div>
					<div>看你顺眼</div>
					<div>静香胖虎</div>
					<div>就是一对</div>
					<div>不容反驳</div>
			</div>
		</div>
		<div class="grey_line"></div>
		<div class="row font_t">
			<div class="col-12">
				<textarea rows="5" placeholder="请输入您的评价"></textarea>
			</div>
		</div>
		<div class="row">
			<div class="col-4"></div>
			<div class="col-4 padding-rl-10px">
				<div class="btn">提交</div>
			</div>
			<div class="col-4"></div>
		</div>
	</div>
</body>
<script>
$(function(){
	$(".btn").click(function(){
		var id = $(".news_bar").attr("value");
		var comment = '';
		$(".smile").find(".smile-active span").each(function(i,t){
			comment += $(this).text()+";";
		});
		$(".comment_tab").find(".active").each(function(i,t){
			comment += $(this).text()+";";
		});
		comment += $("textarea").val();
		$.ajax({
			url:"ssjf/comment.dat",
			type:"post",
			data:{
				complainedId:id,
				complaintContent:comment,
				anonymityState:2
			},
			dataType:"json",
			success:function(result){
				if(result.res == 1){
					location.href='ssjf/index.html';
				}else{
					location.href='ssjf/page/login.html';
				}
			}
		});
	});
});
</script>
</html>
